/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package backingBean;

import controller.ControllerRegistro;
import java.sql.SQLException;

/**
 *
 * @author Juan
 */
public class beanRegistro {
    
    
    private String user;
    private String pass;
    private String pass2;
    private String name;
    private String mail;
    private int cplayed;
    private int cwon;
    private int coins;

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public String getPass() {
        return pass;
    }

    public void setPass(String pass) {
        this.pass = pass;
    }
    
    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @return the mail
     */
    public String getMail() {
        return mail;
    }

    /**
     * @param mail the mail to set
     */
    public void setMail(String mail) {
        this.mail = mail;
    }

    /**
     * @return the cplayed
     */
    
      public int getCplayed() {
        return cplayed;
    }

    /**
     * @param cplayed the cplayed to set
     */
    public void setCplayed(int cplayed) {
        this.cplayed = cplayed;
    }

    /**
     * @return the cwon
     */
    public int getCwon() {
        return cwon;
    }

    /**
     * @param cwon the cwon to set
     */
    public void setCwon(int cwon) {
        this.cwon = cwon;
    }

    /**
     * @return the coins
     */
    public int getCoins() {
        return coins;
    }

    /**
     * @param coins the coins to set
     */
    public void setCoins(int coins) {
        this.coins = coins;
    }
    
    public beanRegistro() {
    }
        public String ingresoAlSistema() throws SQLException { //por revisar el sqlexception
            
        ControllerRegistro ControllerRegistro = new ControllerRegistro();
        if(ControllerRegistro.Registro(user, pass,name,mail,cplayed,cwon,coins)){
        //if(ControllerRegistro.Registro(user,mail)){
            if(pass.equals(pass2)){
              return "yes";
            }else return "no";
            
        } else return "no";
    }
        public String retornarAlIndex(){
            return "returnIndex";
        }

    /**
     * @return the pass2
     */
    public String getPass2() {
        return pass2;
    }

    /**
     * @param pass2 the pass2 to set
     */
    public void setPass2(String pass2) {
        this.pass2 = pass2;
    }
}
